feat(templates): the constructor contract is the module kinds - #594
Open
DemchaAV wants to merge 1 commit into
Open
feat(templates): the constructor contract is the module kinds#594DemchaAV wants to merge 1 commit into
DemchaAV wants to merge 1 commit into
Conversation
A modular template implements one method per CvKind, with no defaults. JSON picks the shape; the template draws the shape. It does not know whether the section is Experience. Adding a kind is adding a method, and every ModularCvTemplate has to implement it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The runtime CV layer treated
CvRenderKit(paragraph / row / entry primitives) as the template contract, andSectionRoleas what a module is. That is the wrong axis for a constructor: a template in the raw does not know Experience from Projects. It knows how to draw prose, a list, a timeline. JSON picks the kind; the template implements the kind. A kit of primitives can absorb a new shape (dash) without any template noticing.What changed
CvConstructoris the contract: one method perCvKind(paragraph,bullets,bulletsStacked,inlineList,entries,entriesDated) and no defaults.render(...)is the exhaustive dispatcher — a new constant without a method is a compile error there too.ModularCvTemplateextendsCvConstructorand no longer haskit(). Every modular preset declares the six methods. Canonical ones forward toModuleRenderer;BlueBanner/EditorialBlueforward through their existing drawing.CvRenderKitstays as the optional primitive hook under a kind method, not the template surface.ClassicSerif(not modular yet) still uses a private kit.CvConstructorKindGateTestholds the bijection and that every modular template declares the methods rather than inheriting a default.Two-column claimed slots still lower through
SectionRouterby role; that placement rewrite is the next PR. Visual output of the existing sample CVs is unchanged.Verification
./mvnw -B -ntp -pl :graph-compose-templates test→ BUILD SUCCESS, 143 tests, 0 failures (includingCvConstructorKindGateTest8/8)../mvnw -B -ntp -pl :graph-compose-templates,:graph-compose-qa -am test -Dtest=CvConstructorKindGateTest,ModularCvTemplateFidelityTest,ModuleSectionParityTest,ModuleSectionKindCoverageTest,CvTemplatesCoverageTest,RoleRoutingTest,LeftoverSectionTest→ BUILD SUCCESS, 139 tests in qa (+ templates gate).DocumentationSnippetCompileTest6/6 green.Lane: templates — constructor contract for runtime CV modules.
Base:
feature/cv-constructor-layer. Next: place runtime modules by kind/slot, then dropSectionRolefromModuleSection.